package com.baizhi.service.imp;

import com.baizhi.dao.AdminDao;
import com.baizhi.entity.Admin;
import com.baizhi.service.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminServiceImp implements AdminService {

   @Resource
   private AdminDao adminDao;
    @Override
    public Admin findAdminByField(Admin admin) {
        return adminDao.selectAdminByField(admin);
    }

    @Override
    public List<Admin> findAll() {
        return adminDao.selectAll();
    }


    @Override
    public void addAdmin(Admin admin) {
        adminDao.insertAdmin(admin);
    }

    @Override
    public void removeAdminById(Integer adminId) {
        adminDao.deleteAdminById(adminId);
    }

    @Override
    public void removeMultiple(Integer[] ids) {
        adminDao.deleteMultiple(ids);
    }

    @Override
    public void renovateAdmin(Admin admin) {
        adminDao.updateAdmin(admin);
    }
}
